package com.newly.api.business.feign;

import com.newly.common.base.constants.ServerUriConstant;
import com.newly.common.base.entity.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: chenruheng
 * @Date: 2022/2/8 11:27
 */
@Api(tags = "货物类型api")
@FeignClient(path = ServerUriConstant.NEWLY_BUSINESS_GOODSTYPE,name = ServerUriConstant.NEWLY_BUSINESS_SERVICE_NAME)
public interface GoodsTypeClient {
    /**
     * 创建企业货物类型
     * @param goodType
     * @return
     */
    @ApiOperation("创建企业货物类型")
    @GetMapping("/createGoodsType")
    R createGoodsType(@RequestParam("goodsType") String goodsType);

    /**
     * 删除货物类型
     * @param ids
     * @return
     */
    @ApiOperation("删除货物类型")
    @GetMapping("/delGoodsType")
    R delGoodsType(@RequestParam("ids") List<String> ids);

    /**
     * 获取货物类型下拉框
     * @return
     */
    @ApiOperation("获取货物类型下拉框")
    @GetMapping("/getGoodsType")
    R getGoodsType(@RequestParam(value = "goodsType",required = false) String goodsType);

    /**
     * 货物类型分页列表
     * @param offset
     * @param limit
     * @param name
     * @param startTime
     * @param endTime
     * @return
     */
    @ApiOperation("货物类型分页列表")
    @GetMapping("/listGoodsType")
    R listGoodsType(@RequestParam(value = "offset",defaultValue = "1") Integer offset,
                    @RequestParam(value = "limit",defaultValue = "10") Integer limit,
                    @RequestParam(value = "goodsType",required = false) String name,
                    @RequestParam(value = "startTime",required = false) String startTime,
                    @RequestParam(value = "endTime",required = false) String endTime);

}
